package com.lijy.operation;

/**
 * @author Lijingyu on 2017/10/17.
 */
public class TestOperation {

    public static void main(String[] args) {
//       realLowSet();
        realHighSet();
    }

    public static void realLowSet() {
        int subLength = 53;
        int realNum = 50;
        int subNum = realNum / subLength;
        int remainder = realNum % subLength;

        System.out.println(subNum);
        System.out.println(remainder);

        if (remainder > 0) {
            subNum ++;
        }
        System.out.println(subNum);

        String[] names = new String[subNum];
        String[] contents = new String[subNum];
        int index = 0;
        for (int i = 0; i < subNum; i++) {
            if (i + 1 == subNum
                    && index + subLength > realNum ) {
                System.out.println("---realNum < subLength--- ");
            } else {
                System.out.println("---realNum > subLength--- ");
            }
            index += subLength;
        }

    }

    public static void realHighSet() {
        int subLength = 53;
        int realNum = 107;
        int subNum = realNum / subLength;
        int remainder = realNum % subLength;

        System.out.println(subNum);
        System.out.println(remainder);

        if (remainder > 0) {
            subNum ++;
        }
        System.out.println(subNum);

        String[] names = new String[subNum];
        String[] contents = new String[subNum];
        int index = 0;
        for (int i = 0; i < subNum; i++) {
            if (i + 1 == subNum
                    && index + subLength > realNum ) {
                System.out.println("---realNum < subLength---");
                System.out.println("---realNum < subLength---: " + index + " realNum = " + realNum);
            }
            else {
                System.out.println("---realNum > subLength---");
                System.out.println("---realNum > subLength---" + index + " index + subLength = " + (index + subLength));
            }
            index += subLength;
        }

    }

}
